import { getAsyncPage } from '@/utils/asyncComponentLoader'

export default {
    path: 'electricity-data',
    name: 'ElectricityData',
    component: getAsyncPage(() => import('@/components/nav/RouteCards.vue')),
    meta: {
        title: '电能数据',
        permission: ['view_electricity_chart', 'view_electricity_daily_report', 'manage_electricity_meter', 'view_electricity_cost']
    },
    children: [{
        path: 'ElectricityDataCenter',
        name: 'ElectricityDataCenter',
        component: getAsyncPage(() => import('@/components/nav/Routesegmented.vue')),
        redirect: { name: 'ElectricityChartAnalysis' },
        meta: {
            title: '电能数据中心',
            menu: '供电',
            icon: 'pie'
        },
        children: [
            {
                path: 'chart-analysis',
                name: 'ElectricityChartAnalysis',
                component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/ElectricityDataCenter/ChartAnalysis/index.vue')),
                meta: {
                    title: '总览',
                    permission: ['view_electricity_chart']
                }
            }, {
                path: 'area-statistics',
                name: 'ElectricityAreaChartAnalysis',
                component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/ElectricityDataCenter/AreaChartAnalysis/index.vue')),
                meta: {
                    title: '按区域统计',
                    permission: ['view_electricity_chart']
                }
            }, , {
                // 按用途统计
                path: 'subcategory',
                name: 'ElectricitySubcategory',
                component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/ElectricityDataCenter/Subcategory/index.vue')),
                meta: {
                    title: '按用途统计',
                    permission: ['view_electricity_chart']
                }
            }
        ]
    }, {
        path: 'intelligent-meter',
        name: 'ElectricityIntelligentMeter',
        component: getAsyncPage(() => import('@/components/nav/Routesegmented.vue')),
        redirect: { name: 'ElectricityDailyMeter' },
        meta: {
            title: '智能抄表',
            menu: '供电',
            icon: 'intelligentMeter'
        },
        children: [{
            path: 'daily-meter',
            name: 'ElectricityDailyMeter',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/IntelligentMeter/DailyMeter/index.vue')),
            meta: {
                title: '日抄表记录',
                permission: ['view_electricity_daily_statistics_report']
            }
        }, {
            path: 'monthly-meter',
            name: 'ElectricityMonthlyMeter',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/IntelligentMeter/MonthlyMeter/index.vue')),
            meta: {
                title: '日统计报表',
                permission: ['view_electricity_daily_statistics_report_detail']
            }
        }, {
            path: 'annual-meter',
            name: 'ElectricityAnnualMeter',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/IntelligentMeter/AnnualMeter/index.vue')),
            meta: {
                title: '月统计报表',
                permission: ['view_electricity_month_statistics_report']
            }
        }, {
            path: 'daily-report',
            name: 'ElectricityDailyReport',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/IntelligentMeter/DailyReport/index.vue')),
            meta: {
                title: '按时段按日报表',
                permission: ['view_electricity_daily_report']
            }
        }]
    }, {
        path: 'electricity-cost',
        name: 'ElectricityCost',
        redirect: { name: 'ElectricityPriceView' },
        component: getAsyncPage(() => import('@/components/nav/Routesegmented.vue')),
        meta: {
            title: '电能费用管理',
            menu: '供电',
            icon: 'cost'
        },
        children: [{
            path: 'price-view',
            name: 'ElectricityPriceView',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/ElectricityCost/PriceView/index.vue')),
            meta: {
                title: '电费概览',
                permission: ['view_electricity_cost'],
            }
        }, {
            path: 'price-setting',
            name: 'ElectricityPriceSetting',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/ElectricityCost/PriceSetting/index.vue')),
            meta: {
                title: '电度电价设置',
                permission: ['set_electricity_price'],
            }
        }, {
            path: 'price-input',
            name: 'ElectricityPriceInput',
            component: getAsyncPage(() => import('@/views/EnergyData/ElectricityData/ElectricityCost/PriceInput/index.vue')),
            meta: {
                title: '实缴电费记录',
                permission: ['allow_input_electricity_charge'],
            }
        }]
    }]
}